   {template 'header'}
   <script src="../addons/bsht_tbk/res/js/main.js"></script>
<style>
.itemgray { 
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
}
</style>


   
   <link rel="stylesheet" type="text/css" href="{$res}css/tops.css"/>
   
  
  
  <div class="main" style="background: #eeeeee;padding-bottom:20px"> 
   <!-- 全部商品列表开始 --> 
   <div class="item_list"> 
    
	
	
	<!--商品-->
	<section id="pageCon" class="goods">
	<div class="brand-list" id="list_box">
	

    
   
  
	</div>
	</section>
   <!--商品-->
	
	
	
    
    {php $tpage=$_GPC['page'];}
     {if empty($_GPC['page'])}{php $tpage=1;$npage=$tpage-1;$npage2=$tpage+1;}{else}{php $npage=$tpage-1;$npage2=$tpage+1;}{/if}
   <div id="list_more" class="loading" style="margin-top:10px">
  <span onclick="get_list(0);">查看更多</span>
   </div>

   </div> 
   <!-- 全部商品列表结束 --> 
  </div> 



<script type="text/javascript">
var limit = {$tpage};
function get_list(ty){
    
    if(ty==1){
	   $("#pageCon .brand-list").html('');
	}else{
	   $("#list_more").html('<div class="am-text-secondary"><span class="am-icon-spinner am-icon-spin"></span> 卖命加载中...</div>');
	   
	}
	
	$.ajax({
	    type : "post",
	    url : "{php echo $this->createMobileUrl('list_tops_ajax',array('op'=>'list'))}",
	    data : {
	    	limit:limit,
	    },
        dataType : "json",		
	    success : function(data) {
	    	if(data.status==200){
						var list = data.content;
						var content = '';
						for(var i=0; i<list.length; i++){

                            


  
content += '<div class="item"><div class="title">'
+'<span>❤ '+list[i]['title']+' '+list[i]['num']+'</span></div>'
+'<a class="discount" href="'+list[i]['jumpurl']+'"><em>去看看</em><br />共'+list[i]['num']+'款<i class="cur"></i></a>'
+'<ul class="clear" style="width:100%">'
+'<li style="width:auto;height:auto;padding-left:10px;padding-right:10px;padding-top:5px"><a href="'+list[i]['jumpurl']+'" class="goods-a" style="width:100%"><img class="loazd lazy-bk" src="../addons/bsht_tbk/res/images/load.gif" data-bk="'+list[i]['thumb']+'" style="width:100%;height:100%;max-width:100%"/>'
+'<div class="mask-box"></div>'
+'<div class="list-price buy" style="padding-bottom:5px">'
+'<span class="price-new" style="font-size:13px;color:#555;">'+list[i]['fxdec']+'</span>'
+'</div></a></li></ul></div>';




						}
                        $("#pageCon .brand-list").append(content);
						//var aa = $(".goods-list li").innerWidth();
                        //$(".brand-list li img").css('height',aa);
						if(list.length=={if $setting['pageno']}{$setting['pageno']}{else}10{/if}){
							$("#list_more").html('<span class="am-text-secondary" onclick="get_list(0);">点击查看更多</span>');
						}else{
							$("#list_more").html('<span></span>');
							$("#list_more").fadeOut(500);
						}		
	                    limit++;

						

//waterfall();
lazy_img();
		    }else if(data.status==-103){
	    		$("#list_more").html('<span>没有更多记录！</span>');
				//dialog("没有更多记录！");
				$("#list_more").fadeOut(500);

	    	}else{
			    $("#list_more").html('<span>没有更多记录！</span>');
				//dialog("没有更多记录！！");
				$("#list_more").fadeOut(500);
			}    	
	    },
	    error : function(xhr, type) {

	    }
	});
	    

}


get_list(0);



function getScrollTop() { 
var scrollTop = 0; 
if (document.documentElement && document.documentElement.scrollTop) { 
scrollTop = document.documentElement.scrollTop; 
} 
else if (document.body) { 
scrollTop = document.body.scrollTop; 
} 
return scrollTop; 
} 


function getClientHeight() { 
var clientHeight = 0; 
if (document.body.clientHeight && document.documentElement.clientHeight) { 
clientHeight = Math.min(document.body.clientHeight, document.documentElement.clientHeight); 
} 
else { 
clientHeight = Math.max(document.body.clientHeight, document.documentElement.clientHeight); 
} 
return clientHeight; 
} 

function getScrollHeight() { 
return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 
} 


$(window).scroll(function () { 
if (getScrollTop() + getClientHeight() == getScrollHeight()) { 

get_list(0);
} 
});
  
</script>
<script>
$(function(){ 
//$('.nav_box').hide();
//$('.app-other').hide();
$(".app-other").css("margin-left","-30px");
$(".app-other").css("width","auto");
$(".app-other").css("min-width","60%");
$(".app-other").css("max-width","90%");
$(".menua").css("color","#5e5e5e");
$(".menuleft").css("margin-left","25px");
});
</script>

    {template 'foot'}
	{template 'footer'}